package com.example.javafx.gridPane;

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.CheckBox;
import javafx.scene.control.TitledPane;
import javafx.scene.layout.Background;
import javafx.scene.layout.Border;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

public class Main_2 extends Application {
    @Override
    public void start(Stage primaryStage) throws Exception {
        Scene scene = new Scene(new Group(),450,250);
        CheckBox checkBox = new CheckBox("确定？");
        TitledPane titledPane = new TitledPane("我的标题",checkBox);
        titledPane.setAlignment(Pos.BASELINE_LEFT);
        //titledPane.setCollapsible(false);//remove closing action
        //titledPane.setAnimated(false);//stop animating

        HBox hBox = new HBox(10);
        hBox.setPadding(new Insets(20,0,0,20));
        hBox.getChildren().setAll(titledPane);
        Group root = (Group) scene.getRoot();
        root.getChildren().add(hBox);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
